# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html

import scrapy


class HuaItem_Famliy(scrapy.Item):
    # define the fields for your item here like:
    Family = scrapy.Field()             # family名称
    CPU = scrapy.Field()                # cpu型号
    ISA = scrapy.Field()
    ClockSpeed = scrapy.Field()         # 主频
    memory = scrapy.Field()
    Disk = scrapy.Field()
    Network = scrapy.Field()
    Usescenes = scrapy.Field()
    Proportion = scrapy.Field()
    pass


HuaPriceMap = {
    '实例规格': "instanceType",
    'cpu': "vCpu",
    '内存': "memory",
    '价格（元/月）': "month_price",
    '价格（元/年）': "year_price",
    '价格（元/2年）7折': "two_yearPrice",
    '价格（元/3年）5折': "three_yearPrice",
    '本地盘（GiB）': "Local_storage_GiB",
    '本地盘': "Local_storage_GiB",
    '价格（元/分钟）': "minute_price",
    '价格（元/小时）': "hour_price"
}

class HuaQuota(scrapy.Item):
    Instance_specification = scrapy.Field()
    vCpu = scrapy.Field()
    accelerator = scrapy.Field()
    FPGA = scrapy.Field()
    GPU = scrapy.Field()
    GPU_Memory = scrapy.Field()
    Memory_GiB = scrapy.Field()
    Pmemory_GiB = scrapy.Field()
    Ememory_GiB = scrapy.Field()
    IPv6 = scrapy.Field()
    Elastic_NC = scrapy.Field()
    IP = scrapy.Field()
    Network_bandwidth_basis_or_burst_GpS = scrapy.Field()
    PPS10000 = scrapy.Field()
    IOPs = scrapy.Field()
    Cloud_disk_bandwidth_base_or_burst_GpS = scrapy.Field()
    vTMP = scrapy.Field()
    Number_of_connections = scrapy.Field()
    Multi_queue = scrapy.Field()
    Local_storage_GiB = scrapy.Field()
    Remarks = scrapy.Field()
    Ascend_RAM_GiB = scrapy.Field()
    virtualized_type =  scrapy.Field()
    NC_MAXnumber = scrapy.Field()
    pass

HuaQuotaMap = {
'规格名称':"Instance_specification", 
'vCPU': "vCpu",
'内存（GiB）':"Memory_GiB", 
'内存(GiB)':"Memory_GiB", 
'最大带宽/基准带宽': "Network_bandwidth_basis_or_burst_GpS",
'最大带宽/基准带宽（Gbps）': "Network_bandwidth_basis_or_burst_GpS",
'网卡多队列数':"Multi_queue", 
'辅助网卡个数上限':"NC_MAXnumber", 
'网卡个数上限':"NC_MAXnumber", 
'虚拟化类型':"virtualized_type", 

'本地盘':"Local_storage_GiB", 
'本地盘（GiB）':"Local_storage_GiB", 
'最大收发包能力':"PPS10000", 
'最大收发包能力（万PPS）':"PPS10000", 
'最大收发包能力（万/PPS）':"PPS10000",
'Ascend RAM（GiB）':'Ascend_RAM_GiB', 
'GPU':"GPU", 
'显存（GiB）':"GPU_Memory", 
'GPU连接技术':'Remarks', 
'平均基准CPU计算性能（%）':'Remarks',
'基准CPU计算性能（%）':"Remarks", 
'Ascend 310':"Remarks", 
'FPGA':"FPGA"
}

class HuaItem_Price(scrapy.Item):
    instanceType = scrapy.Field()
    vCpu = scrapy.Field()
    memory = scrapy.Field()
    minute_price = scrapy.Field()
    hour_price = scrapy.Field()
    month_price = scrapy.Field()
    year_price = scrapy.Field()
    two_yearPrice = scrapy.Field()
    three_yearPrice = scrapy.Field()
    region = scrapy.Field()
    pass


class AliItem(scrapy.Item):
    # define the fields for your item here like:
    Family = scrapy.Field()             # family名称
    CPU = scrapy.Field()                # cpu型号
    ClockSpeed = scrapy.Field()         # 主频
    Proportion = scrapy.Field()
    Disk = scrapy.Field()
    Network = scrapy.Field()
    Usescenes = scrapy.Field()
    pass
class AliQuota(scrapy.Item):
    Instance_specification = scrapy.Field()
    vCpu = scrapy.Field()
    accelerator = scrapy.Field()
    FPGA = scrapy.Field()
    GPU = scrapy.Field()
    GPU_Memory = scrapy.Field()
    Memory_GiB = scrapy.Field()
    Pmemory_GiB = scrapy.Field()
    Ememory_GiB = scrapy.Field()
    IPv6 = scrapy.Field()
    Elastic_NC = scrapy.Field()
    IP = scrapy.Field()
    Network_bandwidth_basis_or_burst_GpS = scrapy.Field()
    PPS = scrapy.Field()
    IOPs = scrapy.Field()
    Cloud_disk_bandwidth_base_or_burst_GpS = scrapy.Field()
    vTMP = scrapy.Field()
    Number_of_connections = scrapy.Field()
    Multi_queue = scrapy.Field()
    Local_storage_GiB = scrapy.Field()
    Remarks = scrapy.Field()
    pass


AliQuotaMap = {
    "实例规格": "Instance_specification",
    "vCPU": "vCpu",
    "网络带宽（Gbit/s）": "Network_bandwidth_basis_or_burst_GpS",
    "网络基础带宽（Gbit/s）": "Network_bandwidth_basis_or_burst_GpS",
    "网络突发带宽（Gbit/s）": "Network_bandwidth_basis_or_burst_GpS",
    "网络带宽基础/突发（Gbit/s）": "Network_bandwidth_basis_or_burst_GpS",
    "网络基础带宽/突发（Gbit/s）": "Network_bandwidth_basis_or_burst_GpS",
    "网络收发包PPS": "PPS",
    "网络收发包PPS（万）": "PPS",

    "存储IOPS基准": "IOPs",
    "云盘IOPS": "IOPs",
    "云盘IOPS基础/突发": "IOPs",
    "云盘带宽（Gbit/s）": "Cloud_disk_bandwidth_base_or_burst_GpS",
    "云盘带宽（Gbit/s） ": "Cloud_disk_bandwidth_base_or_burst_GpS",
    "云盘带宽基础（Gbit/s）": "Cloud_disk_bandwidth_base_or_burst_GpS",
    "云盘带宽基础/突发（Gbit/s）": "Cloud_disk_bandwidth_base_or_burst_GpS",
    "云盘带宽基础/突发（Gbit/s） ": "Cloud_disk_bandwidth_base_or_burst_GpS",

    "支持vTPM": "vTMP",
    "连接数": "Number_of_connections",
    "多队列": "Multi_queue",
    "多队列（主网卡/辅助网卡）": "Multi_queue",

    "本地存储（GiB）": "Local_storage_GiB",
    "本地存储（GB）": "Local_storage_GiB",
    "最大挂载数据盘数量": "Local_storage_GiB",

    "加速器": "accelerator",
    "FPGA": "FPGA",
    "GPU": "GPU",
    "GPU显存": "GPU_Memory",
    "内存（GiB）": "Memory_GiB",
    "持久内存（GiB）": "Pmemory_GiB",
    "含加密内存（GiB）": "Ememory_GiB",

    "支持IPv6": "IPv6",
    "弹性网卡": "Elastic_NC",
    "含支持RDMA特性的弹性网卡": "Elastic_NC",

    "单网的私有IP": "IP",
    "单网卡私有IP": "IP",
    "硬件转码单元": "Remarks",
    "物理内核": "Remarks"
}


class AliQuota(scrapy.Item):
    Instance_specification = scrapy.Field()
    vCpu = scrapy.Field()
    accelerator = scrapy.Field()
    FPGA = scrapy.Field()
    GPU = scrapy.Field()
    GPU_Memory = scrapy.Field()
    Memory_GiB = scrapy.Field()
    Pmemory_GiB = scrapy.Field()
    Ememory_GiB = scrapy.Field()
    IPv6 = scrapy.Field()
    Elastic_NC = scrapy.Field()
    IP = scrapy.Field()
    Network_bandwidth_basis_or_burst_GpS = scrapy.Field()
    PPS = scrapy.Field()
    IOPs = scrapy.Field()
    Cloud_disk_bandwidth_base_or_burst_GpS = scrapy.Field()
    vTMP = scrapy.Field()
    Number_of_connections = scrapy.Field()
    Multi_queue = scrapy.Field()
    Local_storage_GiB = scrapy.Field()
    Remarks = scrapy.Field()
    pass


class tcntItem(scrapy.Item):
    # define the fields for your item here like:
    Family = scrapy.Field()
    CPU = scrapy.Field()
    GPU = scrapy.Field()
    ClockSpeed = scrapy.Field()
    memory = scrapy.Field()
    Disk = scrapy.Field()
    Network = scrapy.Field()
    Usescenes = scrapy.Field()
    Proportion = scrapy.Field()
    pass


tcntQuotaMap = {
    "规格": "Instance_specification",
    "vCPU": "vCpu",
    "内存(GB)": "Memory_GiB",
    "内存（GB）": "Memory_GiB",
    "内存\n（GB）": "Memory_GiB",
    "内存\n(GB)": "Memory_GiB",
    "网络收发包（pps）（出+入）": "PPS",
    "连接数": "Number_of_connections",
    "队列数": "Number_of_queues",
    "内网带宽能力（Gbps）（出+入）": "Intranet_bandwidth_capacity_Gbps",
    "网络收发包(pps)(出+入)": "Intranet_bandwidth_capacity_Gbps",
    "内网带宽能力(Gbps)(出+入)": "Intranet_bandwidth_capacity_Gbps",
    "主频": "Dominant_frequency",
    "持久内存(GB)": "Persistent_memory_GiB",
    "含机密内存(GB)": "Including_confidential_memory_GiB",
    "备注": "Remarks"
}


class tcntQuota(scrapy.Item):
    # define the fields for your item here like:
    Instance_specification = scrapy.Field()             # family名称
    vCpu = scrapy.Field()                # cpu型号
    Memory_GiB = scrapy.Field()
    Persistent_memory_GiB = scrapy.Field()
    Including_confidential_memory_GiB = scrapy.Field()
    PPS = scrapy.Field()         # 主频
    Number_of_connections = scrapy.Field()
    Number_of_queues = scrapy.Field()
    Intranet_bandwidth_capacity_Gbps = scrapy.Field()
    Dominant_frequency = scrapy.Field()
    Remarks = scrapy.Field()
    pass


class BaiItem_Famliy(scrapy.Item):
    # define the fields for your item here like:
    Family = scrapy.Field()             # family名称
    CPU = scrapy.Field()                # cpu型号
    ISA = scrapy.Field()
    ClockSpeed = scrapy.Field()         # 主频
    memory = scrapy.Field()
    Disk = scrapy.Field()
    Network = scrapy.Field()
    Usescenes = scrapy.Field()
    Proportion = scrapy.Field()
    pass


BaiPriceMap = {
    '实例规格': "instanceType",
    'cpu': "vCpu",
    '内存': "memory",
    '价格（元/月）': "month_price",
    '价格（元/年）': "year_price",
    '价格（元/2年）7折': "two_yearPrice",
    '价格（元/3年）5折': "five_yearPrice",
    '本地盘（GiB）': "Local_storage_GiB",
    '本地盘': "Local_storage_GiB",
    '价格（元/分钟）': "minute_price",
    '价格（元/小时）': "hour_price"
}


class BaiItem_Price(scrapy.Item):
    instanceType = scrapy.Field()
    vCpu = scrapy.Field()
    memory = scrapy.Field()
    minute_price = scrapy.Field()
    hour_price = scrapy.Field()
    month_price = scrapy.Field()
    year_price = scrapy.Field()
    two_yearPrice = scrapy.Field()
    five_yearPrice = scrapy.Field()
    Local_storage_GiB = scrapy.Field()
    pass


BaiQuotaMap = {
    "实例规格": "Instance_specification",
    "cpu": "vCpu",
    "CPU": "vCpu",
    "内存": "Memory_GiB",
    "内网基础带宽": "Intranet_bandwidth_Gbps",
    "内网带宽": "Intranet_bandwidth_Gbps",
    "网络收发包": "PPS",
    "队列": "Queues",
    "多队列": "Queues",
    "本地盘（块数*GiB）": "Local_storage_GiB",
    "本地存储": "Local_storage_GiB",
    "本地盘": "Local_storage_GiB"
}


class BaiQuota(scrapy.Item):
    Instance_specification = scrapy.Field()
    vCpu = scrapy.Field()
    Memory_GiB = scrapy.Field()
    Intranet_bandwidth_Gbps = scrapy.Field()
    PPS = scrapy.Field()
    Queues = scrapy.Field()
    Local_storage_GiB = scrapy.Field()
    pass
